{include file="biz/biz_header.html"} 
<script type="text/javascript">
	var order_id = "{$order_info.id}";
</script>
{include file="biz/biz_nav.html"}
<div class="wrap clearfix wb biz-wrap">
{include file="biz/biz_info_header.html"}
<div class="biz_index_box clearfix">

	<div class="p10 clearfix">
		<div class="uc-order">
		<table cellspacing="1" cellpadding="0" border="0" id="order_info">
								<tbody>
								<tr>
									<td class="ltd" width="150">{$LANG.ORDER_SN}：</td>
									<td class="rtd">{$order_info.order_sn}</td>
								</tr>

								<tr>
									<td>订单状态：</td>
									<td class="rtd">
										{if $order_info.status eq 0}
										等待处理
										{elseif $order_info.status eq 1}
										订单成功
										{elseif $order_info.status eq 2}
										订单失败{if $order_info.order_tip}<span class="ml5 icons i005"></span>失败原因：{$order_info.order_tip}{/if}
										{/if}	
									</td>
								</tr>
								
								<tr>
									<td class="ltd">{$LANG.ORDER_CREATE_TIME}：</td>
									<td class="rtd">{function name="to_date" value=$order_info.create_time}</td>
								</tr>
								
								
								<tr>
									<td rowspan="2">下单人信息：</td>
									<td class="rtd">
										手机:{$order_info.tel}
									</td>
								</tr>
								<tr>
									<td class="rtd">
										姓名:{$order_info.contacter} {if $order.sex eq 1}先生{else}女士{/if}
									</td>									
								</tr>
								
								<tr>
									<td class="ltd">订单信息：</td>
									<td class="rtd">
										{foreach from=$order_info.menu item="m"}
										{$m.name} × {$m.nums}
										{/foreach}
									</td>
								</tr>
								<tr>
									<td>订单总额：</td>
									<td>
										{$order_info.total_price}
									</td>
								</tr>
								<tr>
									<td class="ltd">送餐地址：</td>
									<td class="rtd">
										{$order_info.address}
									</td>
								</tr>
												
								<tr>
									<td>
									订单备注：									
									</td>									
									<td style="text-align: left;" class="rtd">
									{$order_info.msg}
									</td>
								</tr>
								
								<tr>
									<td colspan="2">
										
										{if $order_info.status eq 0}
										{if (get_gmtime()-$order_info.create_time) < (1*3600)}<!--保留一小时处理时间-->
										<a href="{url x="biz" r="order#tstep1" p="id=$order_info.id"}" class="uc_gray_btn mr10"><span class="icons i001 mr5"></span>确认订单</a>
										{/if}
										<a href="{url x="biz" r="order#tcancel" p="id=$order_info.id"}" id="BizTOrderCancel" class="uc_gray_btn mr10" target="_blank"><span class="icons i004 mr5"></span>订单失败 </a>
									
										{/if}
										<span class="grebtn grebtn_s lh22">
						                    <i class="green_line"></i>
						                    <strong class="grebtn_in"><a href="{url x="biz" r="order#takeaway"}" class="grebtn_bg">返回订单列表</a></strong>
						                    <i class="green_line"></i>
						                </span>
									</td>
								</tr>
								
							</tbody></table>
		</div>
	</div>
	<div class="blank"></div>
</div><!--end biz_index_box-->
<script type="text/javascript">
	jQuery(function(){
		$("#BizTOrderCancel").bind("click",function(){
			var html ='<div class="pl20 pr20 pt20">';
			html +='<form name="biz_t_order_cancel_from" id="biz_t_order_cancel_from">';
			html +='<table border="0" cellpadding="0" cellspacing="0" width="100%">';
			html +='	<tr>';
			html +='		<td style="width:40px">原因：</td>';
			html +='		<td><textarea name="order_tip" style="width:94%;height:80px" class="f-text"></textarea></td>';
			html +='	</tr>';
			html +='		<tr>';
			html +='	<td colspan="2" style="text-align:center;">';
			html +='		<div class="blank"></div>';
			html +='		<span class="grebtn grebtn_s lh22">';
	        html +='            <i class="green_line"></i>';
	        html +='            <strong class="grebtn_in"><a href="javascript:void(0);" id="sure_cancel_t_btn" class="grebtn_bg">确定</a></strong>';
	        html +='            <i class="green_line"></i>';
	        html +='        </span>';
			html +='	</td>';
			html +='</tr>';
			html +='</table>';
			html +='<input type="hidden" value="{$order_info.id}" name="order_id" />';
			html +='</form>';
			html +='</div>';
			
			$.weeboxs.open(html,{contentType:'text',showButton:true, showCancel:false, showOk:false,title:'',width:300,type:'wee',onopen:function(){
				$("#sure_cancel_t_btn").bind("click",function(){
					if($.trim($("#biz_t_order_cancel_from textarea[name='order_tip']").val())==""){
						$.showErr("请输入撤销订单原因！",function(){
							$("#biz_t_order_cancel_from textarea[name='order_tip']").focus();
						});
						
						return false;
					}
					if(confirm("确定撤销订单吗？")){
						var query = $("#biz_t_order_cancel_from").serialize();
						$.ajax({
							url:APP_ROOT + "/biz.php?ctl=order&act=tcancel",
							data:query,
							type:"post",
							cache:false,
							dataType:"json",
							success:function(result){
								if(result.status==1)
								{
									window.location.reload();
								}
								else{
									$.showErr(result.message);
								}
							}
						});
					}
					else{
						$.weeboxs.close();
					}
					return false;
				});
			}
			});
			return false;
		});
	});
</script>
</div>
{include file="biz/biz_footer.html"} 